package com.yuyou.tas.service.api.feedback.service;

import com.yuyou.tas.service.api.admin.entity.CommJob;
import com.yuyou.tas.service.api.feedback.dto.FeedbackClassPage;
import com.yuyou.tas.service.api.feedback.dto.FeedbackDetailDTO;
import com.yuyou.tas.service.api.feedback.dto.FeedbackListDTO;
import com.yuyou.tas.service.api.feedback.entity.Feedback;
import com.yuyou.tas.service.api.feedback.entity.FeedbackClass;
import com.yuyou.tas.service.api.feedback.entity.FeedbackSituation;
import com.yuyou.tas.service.api.feedback.vo.req.FeedBackEditReqVo;
import com.yuyou.tas.service.api.feedback.vo.req.FeedbackListVo;
import com.yuyou.tas.service.api.feedback.vo.resp.FeedbackClassesVo;
import com.yuyou.tas.service.api.feedback.vo.resp.FeedbackEditDetail;
import com.yuyou.tas.service.api.feedback.vo.resp.FeedbackNameResp;
import com.yuyou.tas.util.bean.Pagination;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(value = "tas-feedback-service")
@RequestMapping(value = "/feedbackAPI")
public interface FeedbackAPI {

    @RequestMapping(value = "/findFeedbackCount")
    int findFeedbackCount(Pagination<FeedbackListDTO> queryPgn);

    @RequestMapping(value = "/feedbackList")
    List<FeedbackListDTO> feedbackList(Pagination<FeedbackListDTO> queryPgn);

    @RequestMapping(value = "/feedbackDetail")
    FeedbackDetailDTO feedbackDetail(@RequestParam("feedbackId")Long feedbackId);

    /**
     * 添加/更新反馈记录
     * @param vo
     * @return
     */
    @RequestMapping(value = "/addOrUpdateFeedbackService")
    ResBoolSimpleInfo<Feedback> addOrUpdateFeedbackService(@RequestBody FeedBackEditReqVo vo);

    /**
     * 添加班级反馈
     * @param classId
     * @param userId
     * @param organId
     * @return
     */
    @RequestMapping(value = "/addFeedbackClass")
    ResBoolSimpleInfo<FeedbackClass> addFeedbackClass(@RequestParam("classId")Long classId , @RequestParam("userId")Long userId , @RequestParam("organId")Long organId);

    /**
     * 批量发布
     * @param feedbackClassId
     * @return
     */
    @RequestMapping(value = "/batchPublish")
    ResBoolSimpleInfo batchPublish(@RequestParam("feedbackClassId")Long feedbackClassId);

    /**
     * 获取反馈编辑页数据：学生列表，反馈内容
     * @param feedbackClassId
     * @param userId
     * @param organId
     * @return
     */
    @RequestMapping(value = "/getFeedbackEditDetail")
    ResBoolSimpleInfo<FeedbackEditDetail> getFeedbackEditDetail(@RequestParam("feedbackClassId")Long feedbackClassId ,
                                             @RequestParam("userId")Long userId ,
                                             @RequestParam("organId")Long organId);

    @RequestMapping(value = "/findFeedbackClass")
    ResBoolSimpleInfo<FeedbackClassPage> findFeedbackClass(@RequestParam("classId")Long classId ,
                                                           @RequestParam("userId")Long userId ,
                                                           @RequestParam("organId")Long organId ,
                                                           @RequestParam("pageIndex")Integer pageIndex ,
                                                           @RequestParam("pageSize")Integer pageSize);
    @RequestMapping(value = "/findAllClassFeedback")
    ResBoolSimpleInfo<List<FeedbackClassesVo>> findAllClassFeedback(@RequestParam("teacherId")Long teacherId ,
                                                                    @RequestParam("trimesterId")Long trimesterId);


    /**
     * 获取需要处理的资源
     * 微信图片、音频->七牛云
     * @return
     */
    @RequestMapping(value = "/findAllNeedOperate")
    List<FeedbackSituation> findAllNeedOperate();

    @RequestMapping(value = "/insert2Job")
    void insert2Job(@RequestBody FeedbackListVo vo);

    @RequestMapping(value = "/AsynUploadJob")
    void AsynUploadJob(@RequestBody CommJob commJob);

    @RequestMapping(value = "/getFeedbackName")
    FeedbackNameResp getFeedbackName(@RequestParam("feedbackId")Long feedbackId);

    @RequestMapping(value = "/selectByPrimaryKey")
    Feedback selectByPrimaryKey(@RequestParam("feedbackId")Long feedbackId);

    @RequestMapping(value = "/feedbackId")
    void set2Read(@RequestParam("feedbackId")Long feedbackId,@RequestParam("userId")Long userId);
}
